#!/usr/bin/env python
# -*- coding:utf-8 -*-

import re

match = re.search(r'[1-9]\d{5}', 'BIT 100081')
print(type(match))
for prop in dir(match):
    attr = getattr(match, prop)
    if not callable(attr):
        print(prop, attr)
if match:
    print(1, match.group(0))

match = re.match(r'[1-9]\d{5}', 'BIT 100081')
if match:
    print(2, match.group(0))

match = re.match(r'[1-9]\d{5}', '100081 BIT')
if match:
    print(3, match.group(0))

ls = re.findall(r'[1-9]\d{5}', 'BIT100081 TSU100084')
print(ls)

ls = re.split(r'[1-9]\d{5}', 'BIT100081 TSU100084')
print(ls)

res = re.sub(r'[1-9]\d{5}', ':zipcode', 'BIT100081 TSU100084')
print(res)

match = re.search(r'PY.*N', 'PYANBNCNDN')
if match:
    print(match.group(0))

match = re.search(r'PY.*?N', 'PYANBNCNDN')
if match:
    print(match.group(0))